package com.ymx.darling.executor.mapping.relation;

import java.lang.reflect.Field;

/**
 * 关联字段的信息封装
 */
public class RelationFieldInfo {
    /**
     * 关联字段
     */
    private Field field;

    /**
     * 加载类型 一对一 或 一对多
     */
    private RelationType relationType;

    /**
     * 关联查询加载器
     */
    private RelationLoader relationLoader;

    /**
     * 子查询结果集映射类型
     */
    private Class<?> fieldType;

    public RelationType getAssociationType() {
        return relationType;
    }

    public void setAssociationType(RelationType relationType) {
        this.relationType = relationType;
    }

    public void setField(Field field) {
        this.field = field;
    }

    public Field getField() {
        return field;
    }

    public String getFieldName() {
        return field.getName();
    }

    public void setFieldType(Class<?> fieldType) {
        this.fieldType = fieldType;
    }

    public Class<?> getFieldType() {
        return fieldType;
    }

    public void setRelationLoader(RelationLoader relationLoader) {
        this.relationLoader = relationLoader;
    }

    public RelationLoader getRelationLoader() {
        return relationLoader;
    }
}
